package utils

import "github.com/gin-gonic/gin"

type Response struct {
	Success bool        `json:"success"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

func RespondJSON(c *gin.Context, status int, data interface{}) {
	c.JSON(status, Response{
		Success: true,
		Message: "success",
		Data:    data,
	})
}

func RespondError(c *gin.Context, status int, message string) {
	c.JSON(status, Response{
		Success: false,
		Message: message,
		Data:    nil,
	})
}